#pragma once
#define _USE_MATH_DEFINES
#include <algorithm>
#include <limits>

#include "../Core/Trig.h"
#include "../Core/Vector.h"
#include "../Core/Matrix.h"
#include "../Core/Ellipsoid.h"

using namespace Core;

namespace Renderer
{
	class Camera
	{
	public:
		Camera();

		Core::Vector3D Up() const;
		void Up(Core::Vector3D val);
		Core::Vector3D Target() const;
		void Target(Core::Vector3D val);
		Core::Vector3D Eye() const;
		void Eye(Core::Vector3D val);
		
		Core::Vector3F EyeHigh() const;
		Core::Vector3F EyeLow() const;

		Core::Vector3D Forward() const;
		Core::Vector3D Right() const;

		double Height(const Ellipsoid* shape);

		double AspectRatio() const;
		void AspectRatio(double val);
		double FieldOfViewX() const;
		double FieldOfViewY() const;
		void FieldOfViewY(double val);

		double PerspectiveFarPlaneDistance() const;
		void PerspectiveFarPlaneDistance(double val);
		double PerspectiveNearPlaneDistance() const;
		void PerspectiveNearPlaneDistance(double val);

		void ZoomToTarget(double radius);

	private:
		Vector3D _eye; Vector3D _target; Vector3D _up;

		double _fieldOfViewY, _fieldOfViewX, _aspectRatio;
		
		double _perspectiveNearPlaneDistance, _perspectiveFarPlaneDistance;
		
	};
}